package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Equip数据管理 */
public class EquipDBModel extends AbstractDBModel<EquipDBModel, EquipEntity>
{
    private static EquipDBModel instance;

    public static EquipDBModel getInstance() {
        if (instance == null) {
            instance = new EquipDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Equip.data";
    }

    /** 创建实体 */
    @Override
    protected EquipEntity MakeEntity(GameDataTableParser parse)
    {
        EquipEntity entity = new EquipEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.Name = parse.GetFieldValueToUTF8String("Name");
        entity.UsedLevel = parse.GetFieldValueToInt("UsedLevel");
        entity.Quality = parse.GetFieldValueToInt("Quality");
        entity.Star = parse.GetFieldValueToInt("Star");
        entity.Description = parse.GetFieldValueToUTF8String("Description");
        entity.Type = parse.GetFieldValueToInt("Type");
        entity.SellMoney = parse.GetFieldValueToInt("SellMoney");
        entity.BackAttrOneType = parse.GetFieldValueToInt("BackAttrOneType");
        entity.BackAttrOneValue = parse.GetFieldValueToInt("BackAttrOneValue");
        entity.BackAttrTwoType = parse.GetFieldValueToInt("BackAttrTwoType");
        entity.BackAttrTwoValue = parse.GetFieldValueToInt("BackAttrTwoValue");
        entity.Attack = parse.GetFieldValueToInt("Attack");
        entity.Defense = parse.GetFieldValueToInt("Defense");
        entity.Hit = parse.GetFieldValueToInt("Hit");
        entity.Dodge = parse.GetFieldValueToInt("Dodge");
        entity.Cri = parse.GetFieldValueToInt("Cri");
        entity.Res = parse.GetFieldValueToInt("Res");
        entity.HP = parse.GetFieldValueToInt("HP");
        entity.MP = parse.GetFieldValueToInt("MP");
        entity.maxHole = parse.GetFieldValueToInt("maxHole");
        entity.embedProps = parse.GetFieldValueToUTF8String("embedProps");
        entity.StrengthenItem = parse.GetFieldValueToInt("StrengthenItem");
        entity.StrengthenLvMax = parse.GetFieldValueToInt("StrengthenLvMax");
        entity.StrengthenValue = parse.GetFieldValueToUTF8String("StrengthenValue");
        entity.StrengthenItemNumber = parse.GetFieldValueToUTF8String("StrengthenItemNumber");
        entity.StrengthenGold = parse.GetFieldValueToUTF8String("StrengthenGold");
        entity.StrengthenRatio = parse.GetFieldValueToUTF8String("StrengthenRatio");
        return entity;
    }
}
